<HTML><HEAD><TITLE>lp_set(++ParamName, ++Value)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(eplex)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>lp_set(++ParamName, ++Value)</H1>
Set a global parameter for the external solver.
<DL>
<DT><EM>ParamName</EM></DT>
<DD>Atom
</DD>
<DT><EM>Value</EM></DT>
<DD>Integer, float, string or structure
</DD>
</DL>
<H2>Description</H2>

<P>
    Set a global parameter. The parameter names are the same as described
    in lp_get/2. For the timeout parameter, Value can be of any numeric
    type. Note that for the external solver's parameters (set via
    optimizer_param(Param)), the exact behaviour is solver dependent: if
    the solver has global parameters, this sets the value of the parameter
    globally; otherwise, this sets the default value of the parameter that
    would be assigned to a new problem. The setting is <EM>not</EM> undone 
    on backtracking.

</P><P>
    This behaviour was changed from that of previous (pre 5.4) versions of
    ECLiPSe, as all solvers had global parameters, and thus there were no
    setting of default values. Code developed under these older versions
    may no longer be setting the external solver's parameters correctly.
    Thus when lp_set/2 sets a default setting, an event lp_set_default_warning
    is raised to warn the user about the difference. This event can be 
    suppressed by the directive 
<PRE>        
        :- set_event_handler(lp_set_default_warning, true/0)
</PRE>

</P><P>
    In addition, lp_set/2 is used to control the output from the external 
    solver:
<DL>
    <DT><TT>lp_set(SolverChannel, +(Stream))</TT>
       <DD>Send output from SolverChannel to the ECLiPSe I/O stream Stream.
    <DT><TT>lp_set(SolverChannel, -(Stream))</TT>
       <DD>Stop sending output from SolverChannel to the ECLiPSe I/O stream 
       Stream.
</DL>
    SolverChannel is one of <TT>result_channel, error_channel, warning_channel, 
    log_channel</TT>, and Stream is an ECLiPSe stream identifier (e.g. 
    <TT>output</TT>, or the result of an open/3 operation).
<P>
    By default, <TT>error_channel</TT> is directed to ECLiPSe's
    <TT>error</TT> stream, <TT>warning_channel</TT> to <TT>warning_output</TT>
    while <TT>result_channel</TT> and <TT>log_channel</TT> are suppressed.
    To see the output on these channels, do
</P>
<TT><PRE>
   :- lp_set(result_channel, +output).
   :- lp_set(log_channel, +log_output).
</PRE></TT>
<P>
Similarly, to create a log file:
<TT><PRE>
   :- open('mylog.log', write, logstream), lp_set(log_channel, +logstream).
</PRE></TT>
and to stop logging:
<TT><PRE>
   :- lp_set(log_channel, -logstream), close(logstream).
</PRE></TT>
</P>
<H3>Resatisfiable</H3>
no
<H2>See Also</H2>
<A HREF="../../lib/eplex/lp_get-2.html">lp_get / 2</A>
</BODY></HTML>
